
package com.deng.springboot.demo.web.config;

import org.springframework.context.annotation.Bean;
import springfox.documentation.builders.ApiInfoBuilder;
import springfox.documentation.builders.PathSelectors;
import springfox.documentation.builders.RequestHandlerSelectors;
import springfox.documentation.service.ApiInfo;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;


/**
 * @Author: DengLibin
 * @Description:   swagger-ui.html
 * @DateTime:  14:05 2018/5/15 0015
 */

//@SpringBootConfiguration
//@EnableSwagger2 //启用Swagger2
public class SwaggerConfig {

   @Bean
    public Docket createRestApi() {
        return new Docket(DocumentationType.OAS_30)
                .apiInfo(apiInfo())
                .select()
                .apis(RequestHandlerSelectors.basePackage("com.deng.springboot.demo.web.controller"))
                .paths(PathSelectors.any())
                .build();
    }
    private ApiInfo apiInfo() {
        return new ApiInfoBuilder()
                .title("接口文档")
                .description("基于springBoot的整合开发")
              //  .termsOfServiceUrl("https://swagger.io/")
               // .contact( new Contact("邓力宾","http://dlbin.top","910807415@qq.com"))
                .version("1.0")
                .build();
    }
}

